import request from '@/utils/request'

export function fetchFiles(data) {
  return request({
    url: '/file/list',
    method: 'get',
    params: data
  })
}

export function downloadZip(params) {
  return request({
    timeout: 50000 * 60,
    url: '/file/downloadZip',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

export function downloadFile(params) {
  return request({
    timeout: 50000 * 60,
    url: '/file/download',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
// 网速比较慢 timeout设成5分钟先...
export function packAndSendEmail(params) {
  return request({
    timeout: 50000 * 60,
    url: '/file/emailFile',
    method: 'post',
    params
  })
}

export function saveFileOption(params) {
  return request({
    url: '/file/save',
    method: 'post',
    params
  })
}

export function deleteCloudFile(params) {
  return request({
    url: '/cloud/delete',
    methoud: 'post',
    params
  })
}

export function listCloudFile(params) {
  return request({
    url: '/cloud/list',
    methoud: 'get',
    params
  })
}

export function downloadCloudFile(params) {
  return request({
    url: '/cloud/download',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
